Page({
    data: {
        paramsList: [],
        projectNameList: [],
        loading: true,
        btnDis: true
    },
    onLoad: function onLoad(options) {
        var params = JSON.parse(options.params);
        this.setData({
            paramsList: params
        });
        var that = this;
        wx.request({
            url: 'http://localhost:8080/wxAppletOpportunity/searchProjectName',
            data: {
                city: that.data.paramsList.city,
                district: that.data.paramsList.district,
                projectName: that.data.paramsList.projectName
            },
            method: 'POST',
            header: {
                'content-type': 'application/json'
            },
            success: function success(res) {
                that.setData({
                    projectNameList: res.data.body,
                    loading: false,
                    btnDis: false
                });
            }
        });
    },
    backToCreateStep1: function backToCreateStep1() {
        wx.navigateBack({
            delta: getCurrentPages().length - 1
        });
    },
    trunToCreateStep3: function trunToCreateStep3(event) {
        var paramsListTemp = this.data.paramsList;
        paramsListTemp["projectName"] = event.target.dataset.projectname;
        this.setData({
            paramsList: paramsListTemp
        });
        wx.navigateTo({
            url: '../createStep3/createStep3?params=' + JSON.stringify(this.data.paramsList)
        });
    }
});